/* 
 * Author: anand
 * 
 */

#ifndef _PLAYLIST_ITEM_H
#define	_PLAYLIST_ITEM_H
 #include <string>

#include "path_util.h"
#include "folder.h"
class playlist_item {
public:
	playlist_item():_path(""), _id(0), _position(0), _name(""),_playcount(0),_folder(){}
    playlist_item(const playlist_item& orig);

     /*Actually delete the item itself*/
    virtual void unlink();
	int get_id(){return _id;}
	void set_id(int id_) { _id = id_;}
    double get_position() {return _position;}
	std::string get_name() {return _name;}
    void set_position(double position_){_position = position_;}
    std::string get_path(){return _path;}
    void set_path(std::string path_){_path = path_;}
    void set_name(std::string name_){_name = name_;}
	std::string get_full_path() {return _path+_name;}
	int get_playcount(){return _playcount;}
	void set_playcount(int playcount_){_playcount = playcount_;}
	void save();
    virtual ~playlist_item();
	bool operator <(const playlist_item & item2) const{return _position < item2._position;}
private:
    std::string _path;
    double _position;
	std::string _name;
	int _playcount;
	int _id;
	folder _folder;
	static dbhelper * _dbhelper;
};

#endif	/* _PLAYLIST_ITEM_H */

